package event;



public class EventFrame extends javax.swing.JFrame {
    //The image panel
    private javax.swing.JPanel imagePanel;
    private javax.swing.JLabel imageLabel;

    public EventFrame(javax.swing.ImageIcon f, String location, String type) {
        super("EventAgent " + type);
        imagePanel = buildImagePanel(f);
        this.addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent e) {
                    System.exit(0);
                }
            });
        getContentPane().setLayout(new java.awt.BorderLayout());
        getContentPane().add(new javax.swing.JLabel(location),
            java.awt.BorderLayout.NORTH);
        getContentPane().add(imagePanel, java.awt.BorderLayout.CENTER);
        pack();
        toFront();
        setVisible(true);
    }

    /**
     *  Build the image panel
     * It is made of one pic
     */
    private javax.swing.JPanel buildImagePanel(javax.swing.ImageIcon i) {
        javax.swing.JPanel temp = new javax.swing.JPanel();
        imageLabel = new javax.swing.JLabel(i);
        temp.add(imageLabel);
        return temp;
    }
}
